﻿<UserControl x:Class="EQual.MainModule.Employees.DetailsViews.EmployeeDistributionView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit" 
    xmlns:MainModule="clr-namespace:EQual.MainModule"     
    >
    <UserControl.Resources >
        <ObjectDataProvider x:Key="DocumentsCollection" ObjectType="{x:Type MainModule:DocumentsProvider}" MethodName="GetDocuments" />

    </UserControl.Resources>
    <Grid>
        <dg:DataGrid Name="datagrid" AutoGenerateColumns="False"    RowEditEnding="dataGrid_RowEditEnding"
                     ItemsSource="{Binding Path=ItemsCollection}"> 
          <dg:DataGrid.Columns >
              <dg:DataGridComboBoxColumn SelectedValueBinding="{Binding Id}"                                            
                                           SelectedValuePath="Id"
                                           DisplayMemberPath="Id"
                                           Header="Id"
                                           ItemsSource="{Binding Source={StaticResource DocumentsCollection}}">
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="IsEditable" Value="True" />
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                </dg:DataGridComboBoxColumn>
 
                <dg:DataGridComboBoxColumn SelectedValueBinding="{Binding Id}"                                            
                                           SelectedValuePath="Id"
                                           DisplayMemberPath="Title"
                                           Header="Title"
                                           ItemsSource="{Binding Source={StaticResource DocumentsCollection}}">
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="IsEditable" Value="True" />
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                </dg:DataGridComboBoxColumn>
            <!--     --> 
              <dg:DataGridTextColumn Binding="{Binding Type}" Header="Type"/>
            </dg:DataGrid.Columns>
 
        </dg:DataGrid>
    </Grid>
</UserControl>
